@import './variables.scss';

#app {


.el-submenu__title span{
  font-family: "PingFangSC-Medium", PingFangSC, sans-serif !important;
             font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            font-size: 16px;
            }
  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: $sideBarWidth;
    position: relative;
  }

  .sidebar-container {
    background-color: #434247;
    transition: width 0.28s;
    width: $sideBarWidth !important;
    height:100% ;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;


    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {

        height:100%
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }
    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      &:hover {
        background-color:$menuHover !important;
      }
    }

    .is-active>.el-submenu__title {
      // color: !important;

    }





    & .nest-menu .el-submenu>.el-submenu__title,
    & .el-submenu .el-menu-item {
      min-width: $sideBarWidth !important;
      background-color: transparent !important;

      &:hover {
        background-color:$menuHover !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: $sideBarMinWidth!important;
    }

    .main-container {
      margin-left: $sideBarMinWidth;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      &>.el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;

          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
    &:hover {
      background-color: $menuHover !important;
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background-color: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}


/* // 这是我后面添加上去的样式






// 侧边栏展开之后的样式 */
 .el-submenu .el-menu-item{
  height: 48px;
  line-height: 48px;
}




#app .app-wrapper.openSidebar{
  .sidebar-logo-container{
    border-bottom: 1px solid #474747;
    // margin-bottom: 60px;
  }


  .el-submenu .el-submenu__title {
    display: flex;
    align-items: center;
    padding-left: 46px  !important;
    margin-bottom: 12px;
     span{
       font-size: 16px;
     }
  }

  ul.el-menu.el-menu--inline{
    >div{
      margin-bottom: 10px;
      span{
        font-size: 14px;
      }
    }
  }



  .el-submenu__title i.sub-el-icon,
  .el-submenu__title .svg-icon{
    /* color:$mainColor1 !important; */
    width: 18px;
    height: 18px;
    font-size: 18px;
    margin-right: 24px;
  }

  .nest-menu .router-link-active{
    background: rgba(255, 255, 255, 0.1);
  }

}

// 侧边栏展开
#app .el-submenu.is-opened{
  .nest-menu{
    .el-menu-item{
      padding-left: 90px !important;
    }

    .router-link-active{
      span{
         position: relative;
         &::before{
           display: inline-block;
           height: 12px;
           width: 12px;
           content: '2';
           font-size: 0;
           position: absolute;
           left: -24px;
           top: 50%;
           transform: translate(-100%,-50%);
           border-radius: 50%;
           overflow: hidden;
           background: $mainColor1;
         }
      }
    }
  }
}
#app .el-submenu {
  .nest-menu{
    .el-menu-item{
      padding-left: 90px !important;
    }
}
}
// 侧边栏合并
#app .el-submenu.is-active{
  .nest-menu{
    .el-menu-item{
      padding-left: 90px !important;
    }

    .router-link-active{
      span{
         position: relative;
         &::before{
           display: inline-block;
           height: 12px;
           width: 12px;
           content: '2';
           font-size: 0;
           position: absolute;
           left: -24px;
           top: 50%;
           transform: translate(-100%,-50%);
           border-radius: 50%;
           overflow: hidden;
           background: $mainColor1;
         }
      }
    }
  }


}



/* // 侧边栏收起时候的样式 */
#app .sidebar-container .el-submenu.is-active .el-submenu__title .svg-icon{
  color: $mainColor1;
}

#app .sidebar-container .el-submenu .el-submenu__title .el-submenu__icon-arrow{
  right: 26px;
  font-size: 18px;
  &::before{
    content: "\e790" !important;
  }
}



#app .hideSidebar .el-menu--collapse .el-submenu > .el-submenu__title > .sub-el-icon{
  font-size: 26px !important;
  margin-left: 36px;

}


#app .hideSidebar .el-menu--collapse .el-submenu > .el-submenu__title > .svg-icon{
height: 20px;
width: 20px;
margin-left: 29px;

}
